<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    c{
      color: rgb(red, green, blue);
    }
  </style>
</head>
<body>
  <div id="app">
    <p :class="{active : isActive}" >aa</p>
    <div v-if="loginType">
      用户名：<input type="text" name="username" key="yhm">
    </div>
    <div v-else>
      邮箱： <input type="text" name="email" key="yx">
    </div>
    <button @click.ctrl.exact="changeLoginType">toggle loginType</button>
    <div>
      <p v-for="(food,index,name) in foods" v-if="food.price>4" :key="index">
        {{index}} {{name}} : {{food}}
      </p>
    </div>
    <div>
      <input type="radio" id="one" value="One" v-model="choose">
      <label for="one">man</label>
      <input type="radio" id="two" value="Two" v-model="choose">
      <label for="two">feman</label>
      <span>{{choose}}</span>
    </div>
    <div>
      <input type="text" v-model.lazy="valueOfInput">
      <p>{{valueOfInput}}</p>
    </div>
  </div>
  
  <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
    <script>
      var app = new Vue({
        el: "#app",
        data: {
          isActive: true,
          loginType: true,
          foods: [{
            name: "薯片",
            price: "5"
          },{
            name: "可乐",
            price: "3"
          }],
          choose: "",
          valueOfInput: "",
        },
        methods: {
          changeLoginType() {
            this.loginType = !this.loginType;
          }
        },
        mounted: function() {
          console.log(this.isActive.style);
        },
      })
    </script>
</body>
</html>